<?php


function getMeter($circle,$q,$r,$w){
	$allLayer = floor($circle / $q); //总共达到的层级
	$cur = 0;
	$high = 0;

	for ($i=0; $i <$allLayer ; $i++) { 
		$cur = $i;
		$high += ($w + $r*$cur)*pi()*$q;
	}

	$mod = $circle % $q;
	$cur++;
	if($mod){
		$high += ($w + $r*$cur)*pi()*$mod;
	}

	return $high;
}

// $j = 0.1;  // 系数

$q = 7;    // 钢丝并排数
$r = 10;   // 钢丝直径
$w = 60;   // 卷扬机内部初始直径

$circle = 13;

echo getMeter($circle, $q, $r, $w);
